<?php /* Update Client Controller */
	require_once('modules/clients/actions/update/scripts/validate-client.php');
	if (isset($_POST['form-action'])) {
		$validacion = validarCliente();
		if (!empty($validacion)) { //fallo validacion
			require_once('modules/clients/actions/update/view/update-client.php');
		} else { //si valido correcto
			$client->update("id=".(int)$glb_uri[2]);
			require_once('modules/clients/actions/list/index.php');
		}
	} else {
		if (@(int)$glb_uri[2] > 0) { //valida que la id ingresa es valida.
			$result = $client->getAllFrom((int)$glb_uri[2]);
			if ($result) { //valida si existe la id.
				require_once('modules/clients/actions/update/view/update-client.php');
			} else {
				echo '<strong>No existe el cliente solicitado.</strong>';
			}
		} else {
			echo '<strong>Pagina invalida.</strong>';
		}
	}
?>